//
//  checkBoxCell.m
//  HeSaid
//
//  Created by ZC on 15/6/1.
//  Copyright (c) 2015年 MWJ. All rights reserved.
//

#import "checkBoxCell.h"

@implementation checkBoxCell{
    NSString *s;
}

- (void)awakeFromNib {
    
    self.checkStr = 1;
    
    self.str=@"0";
    
    [self.check setImage:[UIImage imageNamed:@"white.png"] forState:UIControlStateNormal];
    [self.check addTarget:self action:@selector(click) forControlEvents:UIControlEventTouchUpInside];
    
    self.typeArray=[NSMutableArray array];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}


-(void)click{
    
        if (self.index < 5){
            
            [self lastClick];
            
        }
        else {
            
            [self whiteImg];
            
    }

}

-(void)lastClick{
    
    if (self.checkStr==0) {
        [self whiteImg];
        self.checkStr=1;
        s=@"0";
    }else{
        [self checkImg];
        self.checkStr=0;
        s=@"1";
    }
    
    self.str=s;
    
}


-(void)whiteImg{
    [self.check setImage:[UIImage imageNamed:@"white.png"] forState:UIControlStateNormal];
}

-(void)checkImg{
    [self.check setImage:[UIImage imageNamed:@"check.png"] forState:UIControlStateNormal];
}
@end
